#ifndef DEFORMATOR_H
#define DEFORMATOR_H

#include <QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QDebug>
#include <QFileDialog>
#include <cmath>
#include <QMatrix>
#include <QMouseEvent>
#include <QGraphicsView>
#include "image.h"
#include "rotate.h"
#include "skew.h"
#include "myqgraphicsview.h"
#include "barreldist.h"
namespace Ui {
    class Deformator;
}

class Deformator : public QMainWindow
{
    Q_OBJECT

public:
    explicit Deformator(QWidget *parent = 0);
    ~Deformator();
private slots:
    void obrotDial();
    void openImage();
    void saveImage();
    void skewSliderX();
    void skewSliderY();
    void rotate90l();
    void rotate90p();
    void rotate180();
    void rotateAny();
    void changedBarrelDist();

private:
    void lala();
    QTransform              trans;
    QMatrix                 mat;
    Ui::Deformator*         ui;
    QPixmap*                pixmap;
    QPixmap*                changedPixmap;
    QGraphicsScene*         scene;
    QGraphicsPixmapItem*    item;
    krm::Rotate*            rotate;
    krm::Skew*              skew;
    krm::BarrelDist*        barrelDist;
    int                     posX;
    int                     posY;
};

#endif // DEFORMATOR_H
